package com.sky.mapper;

import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface OrderDetailMapper {
    /**
     * 插入数据到订单详细表中
     * @param odlist
     */
    void insert(List<OrderDetail> odlist);

    /**
     * 根据订单id查询订单明细
     * @param orderId
     * @return
     */
    @Select("select * from order_detail where order_id = #{orderId}")
    List<OrderDetail> getByOrderId(Long orderId);

    /**
     *根据所给区间查询商品名称
     * @param beginTime
     * @param endTime
     * @return
     */
    List<String> getNameByTime(LocalDateTime beginTime, LocalDateTime endTime,Integer status);

    /**
     * 根据所给区间查询商品的销售
     * @param beginTime
     * @param endTime
     * @return
     */
    List<Integer> getNumberByTime(LocalDateTime beginTime, LocalDateTime endTime,Integer status);
}
